package com.soft.controller;

import com.soft.pojo.JobChange;
import com.soft.service.JobChangeService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author ruoxi
 * @create 2021-12-28 16:07
 */
@WebServlet("/showJobChangeInfo")
public class ShowJobChangeInfoServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        int id = Integer.parseInt(req.getParameter("id"));
        JobChangeService jobChangeService = new JobChangeService();
        JobChange jobChange = jobChangeService.findJobChangeById(id);

        req.setAttribute("jobChange", jobChange);
        req.getRequestDispatcher("jobchangeInfo.jsp").forward(req,resp);
    }
}
